package com.example.kotlin.ui;

import android.os.Bundle;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.example.kotlin.R;
import com.example.kotlin.annotation.BindViewTarget;
import com.example.kotlin.utils.ViewUtil;

import jp.wasabeef.glide.transformations.BlurTransformation;

public class GlideActivity extends AppCompatActivity {
    @BindViewTarget(getValue = R.id.imageView)
    ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_glide);
        ViewUtil.INSTANCE.inject(this);

        RequestOptions requestOptions = new RequestOptions();
        BlurTransformation blurTransformation = new BlurTransformation(25, 2);
        requestOptions.transform(new MultiTransformation(blurTransformation, new CircleCrop()));
        Glide.with(this).load("http://wap.yesky.com/uploadImages/2013/265/247Y7IN74W47.png").apply(requestOptions).into(imageView);

    }
}
